home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96a.txt / 000065_icon-group-sender _Wed Mar 6 15:09:39 1996.msg < prev    next >
Internet Message Format  |  1996-09-05  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Wed, 6 Mar 1996 12:20:41 MST
  2. From: "Hamish Lawson" <H.Lawson@tees.ac.uk>
  3. Organization:  University of Teesside (SCM)
  4. To: icon-group@cs.arizona.edu
  5. Date:          Wed, 6 Mar 1996 15:09:39 GMT0BST
  6. Subject:       Re: Production of an operator's left-hand operand
  7. Reply-To: H.Lawson@tees.ac.uk
  8. Priority: normal
  9. X-Mailer: Pegasus Mail for Windows (v2.0-WB2)
  10. Message-Id: <1D200E66B9@scm_arkengarthdale.tees.ac.uk>
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: O
  13.  
  14. I've been trying to make a case for a parallel set of operators that
  15. that produce their left-hand side. The example I chose was of 
  16. printing the result of some expression only if a subsequent 
  17. expression succeeds. It's been pointed out that this can be achieved 
  18. thus:
  19.  
  20.    write(1(e1,e2))
  21.  
  22. It's my own fault for choosing a poor example. Ken Walker did
  23. concede that there is not an equivalent for comparison operators.
  24. Let's choose a better (I hope!) example: say I want to print out
  25. expression e1 only if its value is less than e2. The order of 
  26. evaluation may be important and so 
  27.  
  28.    write(e2 > e1)
  29.  
  30. may not be possible. We're forced to the rather inelegant alternative
  31.  
  32.    write((e1 < (temp := e2), temp))
  33.  
  34. (The temp variable is necessary in the general case because a sceond 
  35. evaluation of e2 may produce a new value.)
  36.  
  37. Thus my proposal of an alternative set of operators that produce 
  38. their RH operands (I suggested prefixing the standard operators with 
  39. ^); our expression then becomes
  40.  
  41.    write(e1 ^< e2)
  42.  
  43.  
  44. | Hamish Lawson, School of Computing and Mathematics, 
  45. | University of Teesside, Middlesbrough, Cleveland, UK, TS1 3BA 
  46. | Tel: +44 1642 218121 x3611  Fax: +44 1642 342604
  47. | E-mail: H.Lawson@tees.ac.uk 
  48.